<script setup lang="ts">
import { ref } from 'vue'
import { getSearch } from '@/services';
import type{SearchResDetail} from '../../../services'
const searchData = ref<SearchResDetail[]>([])


getSearch()
    .then((res) => {
        // console.log(res)
        searchData.value = res.data
    })


const emits = defineEmits()
</script>

<template>
    <uni-section title="搜索历史" type="line">

    </uni-section>
    <uni-section title="热门搜索" type="line">
        <view v-for="item in searchData" :key="item.searchWord" @click="emits('confirm',item.searchWord)">
            {{ item.searchWord }}
        </view>
    </uni-section>
</template>

<style lang="scss" scoped>

</style>